function download() {
  var canvas = document.querySelector("canvas");
  console.log(canvas)
  var url = canvas.toDataURL("image/png");
  var a = document.createElement("a");
  a.download = "地图.png"; // 设置下载的文件名，默认是'下载'
  a.href = url;
  document.body.appendChild(a);
  a.click();
  a.remove();
}
